<template>
  <div class="annotation-container-center-operation-content">
    <div class="annotation-container-center-operation-title"
      >{{ detailMsg.projectName }}-{{ detailMsg.templateName }}</div
    >
    <div class="annotation-container-center-operation-count">
      <span class="currnt-count">( {{ detailMsg.currentCount }}</span> /
      {{ detailMsg.allCount }} )</div
    >
    <div style="margin: 0 24px">
      <el-button @click="handleOperation({ key: 'prev' })">上一张</el-button>
      <el-button @click="handleOperation({ key: 'next' })">下一张</el-button>
    </div>

    <div class="annotation-container-center-operation-list">
      <div
        v-for="item in operationList"
        :key="item.key"
        @click="handleOperation(item)"
        class="annotation-container-center-operation-item"
        :style="item.style"
      >
        <div class="icon-box">
          <component :is="iconMap[item.icon]" class="icon" />
        </div>
      </div>
    </div>
    <div class="annotation-number-box">
      <div v-if="batchOperationRectKeyList.length" style="margin-right: 10px">
        已选中标注:
        <span class="annotation-number">{{ batchOperationRectKeyList.length }}</span>
        个</div
      >
      <div>
        已标注区域: <span class="annotation-number">{{ rectList.length }}</span> 个</div
      >
    </div>
  </div>
</template>

<script setup>
import { ref, watch, computed, onMounted, defineProps, defineEmits } from 'vue'
// import { Search, More, Expand, Fold } from '@element-plus/icons-vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
// const { t } = useI18n()
const t = (key) => key;
const props = defineProps({
  detailMsg: {
    type: Object,
    default: () => ({
      projectName: '',
      templateName: '',
      currentCount: 0,
      allCount: 0
    })
  },
  rectList: {
    type: Array,
    default: () => []
  },
  operationList: {
    type: Array,
    default: () => []
  },
  batchOperationRectKeyList: {
    type: Array,
    default: () => []
  }
})
const emits = defineEmits(['handleOperation'])
const iconMap = ElementPlusIconsVue
function handleOperation(item) {
  emits('handleOperation', item)
}
</script>

<style lang="scss" scoped>
.annotation-container-center-operation-content {
  display: flex;
  height: 48px;
  background: #fff;
  padding: 0 24px;
  align-items: center;

  .annotation-container-center-operation-title {
    font-weight: 600;
    font-size: 14px;
    color: #1e1e1e;
    margin-right: 8px;
  }
  .annotation-container-center-operation-count {
    font-weight: 600;
    font-size: 12px;
    color: #0a0d12;
    .currnt-count {
      color: #444ce7;
    }
  }
}
.annotation-container-center-operation-list {
  // flex: 1;
  display: flex;
  justify-content: center;
  gap: 10px;
  .annotation-container-center-operation-item {
    cursor: pointer;
    .icon-box {
      width: 32px;
      height: 32px;
      border-radius: 3px 3px 3px 3px;
      border: 1px solid #e9eaeb;
      display: flex;
      align-items: center;
      justify-content: center;
      .icon {
        width: 16px;
      }
    }
  }
}

.annotation-number-box {
  display: flex;
  align-items: center;
  margin-left: auto;
  font-weight: 400;
  font-size: 12px;
  color: #000000;
  .annotation-number {
    color: #444ce7;
  }
}
</style>
